package cn.ggcms.cms.dao.impl;

import java.util.List;

import cn.ggcms.cms.dao.CommentDao;
import cn.ggcms.cms.utils.SimpleDao;
import cn.ggcms.cms.vo.Comment;

public class CommentImpl extends SimpleDao<Comment> implements CommentDao {

	public boolean doInsertComment(Comment Comment) {
		boolean flag = false;
		try {
			 super.save(Comment);
			flag = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return flag;
	}
	public Comment findComment(Comment Comment) {
		return Comment;
		
	}
	public Comment finCommentById(int id) {
		return (Comment) super.find(Comment.class,id);
	}
	public List<Comment> finComments() {
		return super.find(Comment.class);
	}
	public boolean doDeleteCommentById(int id) {
		boolean flag = false;
		try {
			super.delete(Comment.class, id);
			flag = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return flag;
		
		
	}
	public boolean doUpdateComment(Comment comment) {
		boolean flag = false;
		try {
			super.update(comment);
			flag = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return flag;
	}

}
